class Solution(object):
    def findSubsequences(self, nums):
        """
        :type nums: List[int]
        :rtype: List[List[int]]
        """
        n = len(nums)
        out = set()
        DP = [set() for _ in range(n)]
        DP[0].add((nums[0],))
        for i in range(1, n):
            for j in range(i):
                if nums[i] >= nums[j]:
                    for key in DP[j]:
                        new_item = key + (nums[i], )
                        out.add(new_item)
                        DP[i].add(new_item)
                DP[i].add((nums[i],))
        return list(out)


data = Solution()
nums = [4, 6, 7, 7]
print(data.findSubsequences(nums))
